<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 用户输入
        var n = parseInt(prompt("请输入一个大于2的偶数"));
        // 判断质数
        function zishu(a) {
            for (var i = 2; i <= Math.sqrt(a) ; i++) {
                if (a % i === 0) {
                    return false;
                }
            }
            if (a != 1) {
                return true;
            } else {
                return false;
            }
        }
        // 输出质数
        for (var i = 2 ; i <= n / 2 ; i++) {
            var j = n - i;
            if (zishu(i) && zishu(j)) {
                alert(n + "可以拆分成两个质数" + i + "与" + j + "的和")
            }
        }
    </script>
</head>
<body>
    
</body>
</html>